package com.yhsimon.realm.member.controller;

import com.yhsimon.realm.member.service.NewsService;
import com.yhsimon.realm.member.utils.R;
import com.yhsimon.realm.member.vo.news.NewsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member/news")
public class NewsController {

    @Autowired
    private NewsService newsService;

    @GetMapping("/listNews")
    public R listNews(){
        List<NewsVo> newsVoList=newsService.listNews();
        return R.ok().put("data",newsVoList);
    }

}
